import React from 'react';
import "./Homehead.css"
import { Menu } from 'antd';
import { useNavigate } from 'react-router-dom';

const Homehead = React.memo(()=>{

    const navigate = useNavigate();

    const items = [
        {
          label: '首页',
          key: '',
        },
        {
          label: '用户',
          key: 'user',
        },
      ];

    const onClick =(e)=>{
        navigate(`/${e.key}`);
    }

    return(
        <div className='homehead'>
            <div className='logo'>LOGO</div>
            <div className='navibar'>
            <Menu onClick={onClick} mode="horizontal" items={items} />
            </div>
        </div>
    )
})

export default Homehead;